package com.adou.d16.isr;

import java.io.*;

public class ISRTest1 {
    public static void main(String[] args) {
        try (
                // 1.创建字符流和源文件接通（GBK）
                InputStream is = new FileInputStream("d1-helloword-app\\src\\it06.txt");

                // 2.把原始字节输入流转成对应字符
                final InputStreamReader isr = new InputStreamReader(is, "GBK");

                // 3.包装成缓冲字节流
                final BufferedReader br = new BufferedReader(isr)
        ) {
            String line;
            while((line = br.readLine()) != null) {
                System.out.print(line);
            }


        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
